package homework0606;

public class ContainerTest1 {
    public static void main(String[] args) {

        Container first = new Container();
        first.add("中国");
        first.add("海军");
        first.add("空军");
        first.add("陆军");
        first.add("坦克兵");
        first.add("步枪手");
        first.add("狙击手");

        Container second = new Container();
        second.add("海军");
        second.add("空军");
        second.add("陆军");
        second.add("坦克兵");

        System.out.println( "first=>" + first );
        System.out.println( "second=>" + second );

        System.out.println( first.containsAll( second ) );

        System.out.println("---------------------------------");

        Container al = new Container();
        al.add( "国防部队" );
        al.add( "武装部队" );
        first.addAll( al );
        System.out.println( first );

        System.out.println("---------------------------------");

        first.removeAll( second );
        System.out.println( first );

        System.out.println("---------------------------------");

        System.out.println( "second=> " + second );

        Container ra = new Container();
        ra.add("空军");
        ra.add("坦克兵");
        ra.add("炮兵");
        second.retainAll( ra );
        System.out.println( second );
    }
}
